import request from '@/utils/request';
import Constants from "@/utils/constants";

// get menu list
export async function fetchMenuData() {
  return request<API.BaseRes>(`${Constants.SERVICE_ROOT}/configuration/getMenuList`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

export async function getAllRoutes() {
  return request<API.BaseRes>(`${Constants.SERVICE_ROOT}/comm/all-route`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}


export async function getLoginUserInfo(options?: { [key: string]: any }) {
  return request<{ data: API.LoginUserData }>(`${Constants.SERVICE_ROOT}/configuration/getLoginUserInfo`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}
